#ifndef DBINFOEDITOR_H
#define DBINFOEDITOR_H

#include <QDialog>
#include "mysqldb.h"

namespace Ui {
class DbInfoEditor;
}

class DbInfoEditor : public QDialog
{
    Q_OBJECT

public:
    explicit DbInfoEditor(QWidget *parent = 0);
    ~DbInfoEditor();

public:
    QString connectName();
    QString hostName();
    QString userName();
    QString password();
    int port();

    DatabaseInfo databaseInfo();

private slots:
    void on_btnTestConn_clicked();

    void on_btnOK_clicked();

    void on_btnCancel_clicked();


    void on_lineEditName_editingFinished();

    void on_lineEditServer_editingFinished();

    void on_lineEditPort_editingFinished();

    void on_lineEditUser_editingFinished();

    void on_lineEditPasswd_editingFinished();

private:
    Ui::DbInfoEditor *ui;

    DatabaseInfo m_dbInfo;
};

#endif // DBINFOEDITOR_H
